home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1998 October / EnigmA AMIGA RUN 31 (1998)(G.R. Edizioni)(IT)[!][issue 1998-10].iso / earkit / browser / awebdecoders / awebjfif / awebjfif.awebrx < prev    next >
Text File  |  1998-09-22  |  7KB  |  182 lines

  1. /* awebjfif.awebrx - Install or uninstall the AWeb JFIF plugin */
  2.  
  3. options results
  4.  
  5. if left(address(),5)~="AWEB." then do
  6.    ports=show("P")
  7.    parse var ports dummy "AWEB." portnr .
  8.    if portnr="" then do
  9.       address command "run AWeb3:AWeb-II"
  10.       address command "WaitForPort AWEB.1"
  11.       portnr=1
  12.    end
  13.    address value "AWEB."portnr
  14.    'get activeport'
  15.    address value result
  16. end
  17.  
  18. parse arg args
  19. parse source dummy1 dummy2 called .
  20. i=lastpos(called,'/')
  21. if i==0 then i=lastpos(called,':')
  22. if i>0 then path=left(called,i)
  23. else path=''
  24.  
  25. if args='' then do
  26.    if ~open(tf,"T:awebjfifsetup.html","W") then exit
  27.  
  28.    call writeln tf,"<html><head><title>AWeb JFIF Setup</title></head>"
  29.    call writeln tf,"<body><h1>AWeb JFIF Setup</h1>"
  30.    
  31.    if exists("AWebPath:awebplugin/awebjfif.awebplugin") then do
  32.       installed=0
  33.       progress=4
  34.       dither=2
  35.       grayscale=0
  36.       maxmem=1024
  37.       lowpri=0
  38.       'getcfg MIME stem m'
  39.       do i=1 to m.0
  40.          if upper(left(m.i.value,11))="IMAGE/JPEG;" then do
  41.             parse var m.i.value type ";" ext ";" action ";" file ";" args
  42.             if action='A' & upper(right(file,19))="AWEBJFIF.AWEBPLUGIN" then do
  43.                installed=1
  44.                j=index(upper(args),"PROGRESS=")
  45.                if j>0 then do
  46.                   progress=substr(args,j+9)
  47.                   j=verify(progress,"0123456789")
  48.                   if j>0 then progress=left(progress,j-1)
  49.                end
  50.                j=index(upper(args),"DITHER=")
  51.                if j>0 then dither=substr(args,j+7,1)
  52.                grayscale=(index(upper(args),"GRAYSCALE")>0)
  53.                j=index(upper(args),"MAXMEM=")
  54.                if j>0 then do
  55.                   maxmem=substr(args,j+7)
  56.                   j=verify(maxmem,"0123456789")
  57.                   if j>0 then maxmem=left(maxmem,j-1)
  58.                end
  59.                lowpri=(index(upper(args),"LOWPRI")>0)
  60.             end
  61.             leave
  62.          end
  63.       end
  64.       
  65.       call writeln tf,"<table border width=100% bgcolor=#aaccaa><tr><td>"
  66.       call writeln tf,"<form action='x-aweb:rexx/"called"'>"
  67.       call writeln tf,"This form configures AWeb-II to use the <strong> AWeb JFIF plugin</strong>."
  68.       call writeln tf,"<input type=hidden name=defprogress value="progress">"
  69.       call writeln tf,"<ol><li>Select the required modes of operation "
  70.       call writeln tf,"(see <a href='file:///AWebPath:awebplugin/docs/awebjfif.html#parameters'>documentation</a> for details)"
  71.  
  72.       call writeln tf,"<p><ul><li>Progressive display:<br>"
  73.       call writeln tf,"<input type=radio name=progress value=0"
  74.       if progress=0 then call writeln tf," checked"
  75.       call writeln tf,"> No progressive display (fastest)<br>"
  76.       call writeln tf,"<input type=radio name=progress value=4"
  77.       if progress=4 then call writeln tf," checked"
  78.       call writeln tf,"> Standard progressive display<br>"
  79.       call writeln tf,"<input type=radio name=progress value=1"
  80.       if progress=1 then call writeln tf," checked"
  81.       call writeln tf,"> Smooth progressive display (slowest)<br>"
  82.  
  83.       call writeln tf,"<p><li>Dither mode. This will only take effect on screens with 256 colours or less.<br>"
  84.       call writeln tf,"<input type=radio name=dither value=0"
  85.       if dither=0 then call writeln tf," checked"
  86.       call writeln tf,"> No dithering (fast but low quality)<br>"
  87.       call writeln tf,"<input type=radio name=dither value=1"
  88.       if dither=1 then call writeln tf," checked"
  89.       call writeln tf,"> Ordered (medium quality, medium speed)<br>"
  90.       call writeln tf,"<input type=radio name=dither value=2"
  91.       if dither=2 then call writeln tf," checked"
  92.       call writeln tf,"> Floyd-Steinberg (good quality but slower)<br>"
  93.       
  94.       call writeln tf,"<p><li><input type=checkbox name=grayscale value=GRAYSCALE"
  95.       if grayscale>0 then call writeln tf," checked"
  96.       call writeln tf,"> Grayscale images"
  97.       
  98.       call writeln tf,"<p><li>Maximum scratch memory usage per image during the decoding process."
  99.       call writeln tf,"If more memory is needed, a virtual memory system will be used.<br>"
  100.       call writeln tf,"<input name=maxmem size=8 value="maxmem"> kB"
  101.       
  102.       call writeln tf,"<p><li>Multitasking:<br>"
  103.       call writeln tf,"<input type=checkbox name=lowpri value='LOWPRI'"
  104.       if lowpri then call writeln tf," checked"
  105.       call writeln tf,"> Run decoder at low priority<br>"
  106.  
  107.       call writeln tf,"</ul>"
  108.       call writeln tf,"<p><li><input type=checkbox name=save value=yes checked> Save the new settings"
  109.       call writeln tf,"<p><li><input type=submit value='Install AWeb JFIF plugin'>"
  110.       call writeln tf,"</ol></form></table>"
  111.  
  112.       if installed>0 then do
  113.          call writeln tf,"<p><table border width=100% bgcolor=#ccaaaa><tr><td>"
  114.          call writeln tf,"<form action='x-aweb:rexx/"called"'>"
  115.          call writeln tf,"<input type=hidden name=deinstall value=''>"
  116.          call writeln tf,"This form will deinstall the AWeb JFIF plugin and reset the default (datatypes) decoder for JFIF images."
  117.          call writeln tf,"<ol><li><input type=checkbox name=save value=yes checked> Save the new settings"
  118.          call writeln tf,"<p><li><input type=submit value='De-install AWeb JFIF plugin'>"
  119.          call writeln tf,"</ol></form></table>"
  120.       end
  121.  
  122.    end
  123.    else do
  124.       call writeln tf,"Plugin file not found. You have to run the install script first."
  125.    end
  126.    
  127.    call writeln tf,"<p><hr><p><a href='file:///AWebPath:awebplugin/docs/awebjfif.html'>Back to documentation</a>"
  128.    
  129.    call close tf
  130.    'open "file:///T:awebjfifsetup.html" reload'
  131.    'wait "file:///T:awebjfifsetup.html"'
  132.    'allowcmd'
  133.    address command 'delete T:awebjfifsetup.html quiet'
  134.  
  135. end
  136. else do
  137.    
  138.    ext="jpg jpeg jfif"
  139.    rest=";"
  140.    
  141.    'getcfg MIME stem m'
  142.    do i=1 to m.0
  143.       if upper(left(m.i.value,11))="IMAGE/JPEG;" then do
  144.          parse var m.i.value type ";" ext ";" action ";" rest
  145.          leave
  146.       end
  147.    end
  148.  
  149.    if upper(left(args,9))="DEINSTALL" then do
  150.       mime="IMAGE/JPEG;"ext";;"rest
  151.    end
  152.    else do
  153.       progress=""
  154.       defprogress="4"
  155.       dither="2"
  156.       grayscale=""
  157.       maxmem="1024"
  158.       lowpri=""
  159.       save=""
  160.       
  161.       do while args~=""
  162.          parse var args nextarg args
  163.          interpret nextarg
  164.       end
  165.       
  166.       if progress="" then progress=defprogress
  167.       mime="IMAGE/JPEG;"ext";A;AWebPath:awebplugin/awebjfif.awebplugin;PROGRESS="progress" DITHER="dither" "grayscale" MAXMEM="maxmem lowpri
  168.    end
  169.    
  170.    'setcfg MIME "'mime'" ADD'
  171.  
  172.    if upper(save)="YES" then do
  173.       'savesettings'
  174.    end
  175.  
  176.    'open "file:///AWebPath:awebplugin/docs/awebjfif.html"'
  177.  
  178. end
  179.  
  180. exit
  181.  
  182.